package com.xiaochong.tir.apiservice.scheduled;

import com.xc.logclient.utils.LogTrace;
import com.xiaochong.tir.apiservice.config.ExecutorConfig;
import com.xiaochong.tir.apiservice.service.ExchangeTransactionpairMiddleService;
import com.xiaochong.tir.common.util.LogTraceKeysUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;


/**
 * Created by wujiaxing on 2018/6/02.
 */
@Component
public class ExchangeTransactionpairScheduled {

    @Resource
    private ExchangeTransactionpairMiddleService exchangeTransactionpairMiddleService;


    @Async(ExecutorConfig.SCHEDULER_EXECUTOR_POOL)
    @Scheduled(cron="0 0 1 * * ?")
    public void exchangeTransactionpairEnable() {
        LogTrace.beginTrace("定时任务ExchangeTransactionpairMiddle");
        LogTrace.info(LogTraceKeysUtils.EXCHANGE_TRANSACTIONPAIR_MIDDLE, LogTraceKeysUtils.DATA,"开始执行定时任务ExchangeTransactionpairMiddle");
        exchangeTransactionpairMiddleService.toEnable();
        LogTrace.info(LogTraceKeysUtils.EXCHANGE_TRANSACTIONPAIR_MIDDLE, LogTraceKeysUtils.DATA, "ExchangeTransactionpairMiddle定时执行完成");
        LogTrace.endTrace();
    }


}
